home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Open Transport / Sample Code / NetFractal™ / ES stuff□ / AWindow.cpp < prev    next >
Encoding:
Text File  |  1996-11-19  |  1.1 KB  |  80 lines  |  [TEXT/MPCC]

  1. //    AWindow.cpp
  2.  
  3. #include <UReanimator.h>
  4. #include "AWindow.h"
  5. #include "ScreenTarget.h"
  6. #include <stdio.h>
  7. #include "DrawPoint.h"
  8.  
  9.  
  10. AWindow *
  11. AWindow::CreateWindow(
  12.     short id,
  13.     LCommander *super)
  14. {
  15.     SetDefaultCommander(super);
  16.     AWindow    *theWindow =
  17.             (AWindow*) UReanimator::ReadObjects('PPob', id);
  18.     theWindow->FinishCreate();
  19.     if (theWindow->HasAttribute(windAttr_ShowNew)) {
  20.         theWindow->Show();
  21.     }
  22.     
  23.     return theWindow;
  24. }
  25.  
  26.  
  27. AWindow *
  28. AWindow::CreateWindowStream(
  29.     LStream *stream)
  30. {
  31.     return new AWindow(stream);
  32. }
  33.  
  34.  
  35. AWindow::~AWindow()
  36. {
  37.     if (fNetPoint) {
  38.         delete fNetPoint;
  39.     }
  40. }
  41.  
  42.  
  43. void
  44. AWindow::DoSetPosition(
  45.     Point inPosition)
  46. {
  47.     inherited::DoSetPosition(inPosition);
  48.     MaybeRefresh();
  49. }
  50.  
  51.  
  52. void
  53. AWindow::DoSetBounds(
  54.     const Rect &inBounds)
  55. {
  56.     inherited::DoSetBounds(inBounds);
  57.     MaybeRefresh();
  58. }
  59.  
  60.  
  61. void
  62. AWindow::SendAESetPosition(
  63.     Point    inPosition,
  64.     Boolean    inExecuteAE)
  65. {
  66.     inherited::SendAESetPosition(inPosition, inExecuteAE);
  67.     MaybeRefresh();
  68. }
  69.  
  70.  
  71. void
  72. AWindow::MaybeRefresh()
  73. {
  74.     if (fScreenTarget) {
  75.         fScreenTarget->UpdateFromWindow(mMacWindowP);
  76.         Rect r = mMacWindowP->portRect;
  77.         InvalPortRect(&r);
  78.     }
  79. }
  80.